use error::AppErr;
use log::LevelFilter;
use simplelog::{ConfigBuilder, SimpleLogger};

mod store;
mod server;
mod config;
mod error;
mod utils;

fn init_log() {
    let config = ConfigBuilder::new()
        .set_time_offset_to_local().unwrap()
        .build();
    
    SimpleLogger::init(LevelFilter::Info, config).unwrap();
}

#[tokio::main]
async fn main() -> Result<(), AppErr> {
    init_log();

    config::init().await?;
    store::init().await?;
    server::run().await?;
    Ok(())
}



